import request from '@/utils/request'

export function createOrder(data) {
	return request({
		url: '/wx/module/create/book/order',
		method: 'post',
		data: data
	})
}

export function createGoodsOrder(data) {
	return request({
		url: '/wx/module/pay/goods',
		method: 'post',
		data: data
	})
}



export function bookOrderList(status) {
	return request({
		url: '/wx/module/book/order/list',
		method: 'get',
		params: {
			status: status
		}
	})
}

export function goodsOrderList(status) {
	return request({
		url: '/wx/module/goods/order/list',
		method: 'get',
		params: {
			status: status
		}
	})
}

export function checkBorrowNum() {
	return request({
		url: '/wx/module/check/borrow/num',
		method: 'get'
	})
}

export function updateStatus(status, orderId) {
	return request({
		url: '/wx/module/update/book/status',
		method: 'get',
		params: {
			status: status,
			orderId: orderId
		}
	})
}

export function updateGoodsStatus(status, orderId) {
	return request({
		url: '/wx/module/update/goods/status',
		method: 'get',
		params: {
			status: status,
			orderId: orderId
		}
	})
}

export function orderInfo(orderId) {
	return request({
		url: '/wx/module/get/order/info',
		method: 'get',
		params: {
			orderId: orderId
		}
	})
}

export function createPreOrder(data) {
	return request({
		url: '/wechatPay/vxv3pay',
		method: 'post',
		data: data
	})
}

export function getGoodsOrderDetail(orderId) {
	return request({
		url: '/wx/module/goods/order/info',
		method: 'get',
		params: {
			orderId: orderId
		}
	})
}